<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <form action="">
        <input type="text" name="userName"><br>
        <input type="submit" value="登录">

        <button>提交</button>
    </form>

    <script>
        document.getElementsByTagName('button')[0].onclick = function(){
            alert('弹出一致老母鸡');
        }
    </script>
</body>
</html>